package com.gaoyu.smarttools.activity

import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.Button
import com.gaoyu.smarttools.R
import com.gaoyu.smarttools.bean.Constant
import com.gaoyu.smarttools.databinding.ActivityMainBinding

class MainActivity : BaseActivity() {
    private lateinit var binding:ActivityMainBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)
        initViews()
    }

    private fun initViews() {
        binding.tvGree.setOnClickListener { goNextPage(Constant.AC_TYPE_GREE) }
        binding.tvHaier.setOnClickListener { goNextPage(Constant.AC_TYPE_HAIER) }
        binding.tvAokes.setOnClickListener { goNextPage(Constant.AC_TYPE_AOKES) }
    }

    private fun goNextPage(type: Int) {
        val intent = Intent(this, IndexActivity::class.java)
        intent.putExtra("type", type)
        startActivity(intent)
    }
}
